<template>
  <div class="loading-wrapper">
    <div v-if="loading" class="loading-mask">
      <el-loading :loading="loading" />
    </div>
    <slot></slot>
  </div>
</template>

<script setup lang="ts">
defineProps<{
  loading: boolean
}>()
</script>

<style scoped>
.loading-wrapper {
  position: relative;
  min-height: 200px;
}

.loading-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
</style> 